package com.jumi.microservice.material.dto;

import com.jumi.microservice.common.excel.annotation.Excel;
import com.jumi.microservice.common.excel.annotation.Excel.Type;
import com.jumi.microservice.material.domain.JmGoodsTax;

import io.swagger.annotations.ApiModelProperty;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.List;

/**
 * 产品类(响应类)
 *
 * @author ssk
 * @create 2020/8/4 14:55
 **/
public class JmGoodsResponse implements Serializable {

    private static final long serialVersionUID = -8888753324947958062L;

    @ApiModelProperty("产品ID")
    private Long goodsId;

    @ApiModelProperty("产品编码")
    @Excel(name = "产品编码",type = Type.EXPORT)
    private String goodsCode;

    @ApiModelProperty("产品名称")
    @Excel(name = "产品名称")
    private String goodsName;

    @ApiModelProperty("旺店通产品ID")
    private Long wdtGoodsId;

    /**
     * 物料数量
     */
    @ApiModelProperty("包含物料数量")
    @Excel(name = "包含物料数量",type = Type.EXPORT)
    private Integer materialNum;

    @ApiModelProperty("分类ID")
    private Long cateId;

    @ApiModelProperty("分类名称")
    @Excel(name = "分类名称")
    private String cateName;

    /**
     * 产品类型;0=售卖产品,1=其他产品
     */
    @ApiModelProperty("产品类型")
    @Excel(name = "产品类型", readConverterExp = "0=售卖产品,1=其他产品")
    private Integer goodsType;

    @ApiModelProperty("单位ID")
    private Long unitId;

    @ApiModelProperty("最小单位名称")
    @Excel(name = "最小单位名称")
    private String unitName;

    @ApiModelProperty("保质期(月)")
    @Excel(name = "保质期(月)")
    private Integer expire;

    @ApiModelProperty("供应商ID")
    private Long supplierId;

    @ApiModelProperty("供应商联系人名称")
    private String supplierName;

    @ApiModelProperty("厂家名称")
    @Excel(name = "供应商厂家名称")
    private String supplierCompanyName;

    @ApiModelProperty("状态;0=未禁用,1=已禁用")
    @Excel(name = "状态",readConverterExp = "0=启用,1=禁用",type = Type.EXPORT)
    private Integer status;


    private List<JmMaterialResponse> materials;

    private List<JmAttrResponse> attrs;

    @Excel(name = "条形码",type = Type.IMPORT)
    private String barCode;

    @Excel(name = "第三方编码",type = Type.IMPORT)
    private String otherCode;

    @Excel(name = "属性",type = Type.IMPORT)
    private String attrName;

    @Excel(name = "属性值",type = Type.IMPORT)
    private String specName;

    @Excel(name = "毛重",type = Type.IMPORT)
    private BigDecimal weight;

    @Excel(name = "税收编码")
    private String taxCode;

    @ApiModelProperty("商品的税务对象")
    private JmGoodsTax jmGoodsTax;

    public String getTaxCode()
    {
        return taxCode;
    }

    public void setTaxCode(String taxCode)
    {
        this.taxCode = taxCode;
    }

    public JmGoodsTax getJmGoodsTax()
    {
        return jmGoodsTax;
    }

    public void setJmGoodsTax(JmGoodsTax jmGoodsTax)
    {
        this.jmGoodsTax = jmGoodsTax;
    }

    public Long getGoodsId() {
        return goodsId;
    }

    public void setGoodsId(Long goodsId) {
        this.goodsId = goodsId;
    }

    public String getGoodsCode() {
        return goodsCode;
    }

    public void setGoodsCode(String goodsCode) {
        this.goodsCode = goodsCode;
    }

    public String getGoodsName() {
        return goodsName;
    }

    public void setGoodsName(String goodsName) {
        this.goodsName = goodsName;
    }

    public Integer getMaterialNum() {
        return materialNum;
    }

    public void setMaterialNum(Integer materialNum) {
        this.materialNum = materialNum;
    }

    public Long getCateId() {
        return cateId;
    }

    public void setCateId(Long cateId) {
        this.cateId = cateId;
    }

    public String getCateName() {
        return cateName;
    }

    public void setCateName(String cateName) {
        this.cateName = cateName;
    }

    public Integer getGoodsType() {
        return goodsType;
    }

    public void setGoodsType(Integer goodsType) {
        this.goodsType = goodsType;
    }

    public Long getUnitId() {
        return unitId;
    }

    public void setUnitId(Long unitId) {
        this.unitId = unitId;
    }

    public String getUnitName() {
        return unitName;
    }

    public void setUnitName(String unitName) {
        this.unitName = unitName;
    }

    public Integer getExpire() {
        return expire;
    }

    public void setExpire(Integer expire) {
        this.expire = expire;
    }

    public Long getSupplierId() {
        return supplierId;
    }

    public void setSupplierId(Long supplierId) {
        this.supplierId = supplierId;
    }

    public String getSupplierName() {
        return supplierName;
    }

    public void setSupplierName(String supplierName) {
        this.supplierName = supplierName;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public List<JmMaterialResponse> getMaterials() {
        return materials;
    }

    public void setMaterials(List<JmMaterialResponse> materials) {
        this.materials = materials;
    }

    public List<JmAttrResponse> getAttrs() {
        return attrs;
    }

    public void setAttrs(List<JmAttrResponse> attrs) {
        this.attrs = attrs;
    }

    public Long getWdtGoodsId() {
        return wdtGoodsId;
    }

    public void setWdtGoodsId(Long wdtGoodsId) {
        this.wdtGoodsId = wdtGoodsId;
    }

    public String getSupplierCompanyName() {
        return supplierCompanyName;
    }

    public void setSupplierCompanyName(String supplierCompanyName) {
        this.supplierCompanyName = supplierCompanyName;
    }

    public String getBarCode() {
        return barCode;
    }

    public void setBarCode(String barCode) {
        this.barCode = barCode;
    }

    public String getOtherCode() {
        return otherCode;
    }

    public void setOtherCode(String otherCode) {
        this.otherCode = otherCode;
    }

    public String getAttrName() {
        return attrName;
    }

    public void setAttrName(String attrName) {
        this.attrName = attrName;
    }

    public String getSpecName() {
        return specName;
    }

    public void setSpecName(String specName) {
        this.specName = specName;
    }

    public BigDecimal getWeight() {
        return weight;
    }

    public void setWeight(BigDecimal weight) {
        this.weight = weight;
    }

    public JmGoodsResponse format(JmGoodsResponse obj)
    {
        obj.setTaxCode(obj.getTaxCode().trim());
        return obj;
    }
}
